package demo;
import annotation.Get;
import annotation.Mapping;
import annotation.Param;
import annotation.Post;

@Mapping("/user")
public class UserAction {
    @Mapping("/login")
    public String hello(@Param("phone") String phone,@Param("user")User user) {
        return "<h1>Hello, " + phone + "</h1>";
    }
    
    @Get
    @Mapping("/register")
    public String register(Integer a){
    	return "<h1></h1>";
    }
    
    @Post
    @Mapping("/confirm/$0")/*$+paramindex*/
    public void confirm(String name, @Param("hobby")String[] hobby, @Param("user")User user){
    	System.out.println(name);
    	
    	if( hobby != null){
			for(String s : hobby){
				System.out.println(s);
			}
    	}
    	
    	System.out.println("name："+user.getUsername());
    	System.out.println("name："+user.getPassword());
    }
}